/*
 * TaskFactory.h
 *
 *  Created on: 10.04.2010
 *      Author: artur
 */

#ifndef TASKFACTORY_H_
#define TASKFACTORY_H_

#include <kiddie/kiddie.h>
#include <sys/sched/task/Task.h>
#include <mem/VmMap.h>
#include <sys/elf.h>

namespace kernel
{
	namespace sys
	{
		namespace sched
		{
			namespace task
			{

				class TaskFactory
				{
					public:
						TaskFactory();
						~TaskFactory();
						Task *newTask(
								kernel::sys::sched::task::Task::task_entry_t,
								kernel::sys::sched::task::Task::LEVEL);
						Task *newTask(kernel::sys::sched::task::Task::LEVEL _l);
						TaskFactory &operator <<(
								kernel::mem::page::PageFactory &p);
						TaskFactory &operator <<(kernel::cmd::CMD mode);
						kernel::sys::sched::task::Task *taskFromMemory(vaddr_t);
					private:
						kernel::mem::page::PageFactory *pFactory;
						kernel::mem::VmMap kmap;
						void init(void);
				};

			}
		}
	}
}

#endif /* TASKFACTORY_H_ */
